package com.zlsy.thread.concurrentcontainer.predecessor;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zhouliang
 * @date 2020/8/28 17:39
 * 演示map的基本用法
 */
public class MapDemo {
    public static void main(String[] args) {
        Map<String, Integer> map = new HashMap<>();
        System.out.println(map.isEmpty());
        map.put("a", 1);
        map.put("b", 2);
        System.out.println("遍历map的key和value:" + map.entrySet());
        System.out.println("遍历map的key:" + map.keySet());
        System.out.println("map的大小:" + map.size());
        System.out.println("map里面是否包含某个key:" + map.containsKey("a"));
    }
}
